/**
 * Created by txl-pc on 2017/7/11.
 */
export default {
  deviceMap () {
    try{
      return http.http('base')
        .get('/device/map')
        .then((res) => {
          return res
        }).catch((e)=>{
          console.log(e)
        })
    }catch(e){
      console.log(e)
    }
  },
  device2(name){
    return $.ajax({url: window.config.mapIp + "/tupu/detail",
      type:"get",
      xhrFields: {
        withCredentials: true
      },
      crossDomain: true,
      dataType:"json",
      data:{
        name: name
      },
    })
  },
  equipmentDataAjax(url) {
    $.support.cors = true;
    return $.ajax({
      url:url,
      type:"get",
      async:false,
      dataType:"json"
    })
  }
}